package com.toby.demo.concurrent.a;

import org.apache.dubbo.rpc.*;

public class HelloFilter implements Filter, Filter.Listener {

    @Override
    public Result invoke(Invoker<?> invoker, Invocation invocation) throws RpcException {
        return invoker.invoke(invocation);
    }

    @Override
    public void onResponse(Result appResponse, Invoker<?> invoker, Invocation invocation) {
        for (int i = 0; i < 100000; i++) {
            RpcContext.getContext().setAttachment(String.valueOf(i), "欢迎关注微信公众号：肥朝");
        }
    }

    @Override
    public void onError(Throwable t, Invoker<?> invoker, Invocation invocation) {

    }
}
